home *** CD-ROM | disk | FTP | other *** search
- //show parts starting from left to right
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //texture sampler
- sampler2D sampTex;
-
- //max x position to show
- float maxX;
- float maxZ;
-
- //shader input
- struct PS_INPUT
- {
- float4 Color : COLOR;
- float2 Tex0 : TEXCOORD0;
- float4 Pos : TEXCOORD1;
- };
-
- //shader code
- float4 PShader(PS_INPUT In) : COLOR
- {
- /*
- clip(In.Pos.x-maxX);
-
-
- //mod vert color with texture color
- float4 clr;
- float4 texclr=tex2D(sampTex,In.Tex0);
-
- //clr.xyz=texclr.xyz*In.Color.xyz;
- clr.xyz=1-(1-texclr.xyz)*In.Color.xyz;
-
- //alpha based on x
- clr.a=saturate((In.Pos.x-maxX)*1.5f)*texclr.a;
-
- //spit out color
- return clr;
- */
-
- //??? ... !
- float4 clr;
- float4 texclr=tex2D(sampTex,In.Tex0);
-
- if(texclr.g<0.715f)
- {
- clr.xyz = lerp(In.Color.xyz,1,(maxZ-In.Pos.z)/maxZ);
- }
- else
- clr.xyz = texclr.xyz;
-
- clr.a=(In.Pos.x-maxX)*texclr.a;
-
- //spit out color
- return clr;
-
- }
-